#ifndef __HAL_I2C_SLAVE__
#define __HAL_I2C_SLAVE__
#include "hal_types.h"
#include "osal.h"

#define LM_PM_MCU_I2C_ADDR  0x0C
#define I2C_SLAVE_ADDR (LM_PM_MCU_I2C_ADDR<<1)

// i2c slave event define
typedef enum i2cSlaveEventEnum{
    I2C_SLAVE_START,
	I2C_SLAVE_RECV_DATA,
	I2C_SLAVE_SEND_COMPLETE,
    I2C_SLAVE_LENGTH_READ,
	I2C_SLAVE_COM_TIME_OUT
}si2c_event_e;

typedef struct
{
  osal_event_hdr_t hdr;
  si2c_event_e event;
  
} i2cSlaveEvent_t;


extern void  HalI2cSlaveInit(void);

extern uint8 HalI2cSlaveWrite(uint8* data,uint16 size);

extern uint16 HalI2cSlaveRead(uint8* data,uint16 size);

extern uint16 HalI2cSlaveClearTx(void);

extern uint16 HalI2cSlaveGetRecvUsedSize(void);

extern uint16 HalI2cSlaveGetRecvUnusedSize(void);

extern uint16 HalI2cSlaveGetSendUsedSize(void);

extern uint16 HalI2cSlaveGetSendUnusedSize(void);

extern void HalI2cSlaveDiscardSend(uint16 size);

extern void HalI2cSlaveDiscardRecv(uint16 size);

extern uint8 RegisterForI2cSlave(uint8 task);





#endif

